home *** CD-ROM | disk | FTP | other *** search
- /*
- ** $VER: newline_indent.ped 1.0 (7.5.95) written by Robert Brandner
- **
- ** Inserts a new, empty line after the current one, and indents the
- ** cursor to the beginning of that line.
- **
- */
-
- OPTIONS RESULTS
-
- OPTIONS FAILAT 11 /* ignore warnings */
- SIGNAL ON SYNTAX /* ensure clean exit */
- SIGNAL ON FAILURE
-
- if (LEFT(ADDRESS(), 6) ~= "POLYED") then do
- if SHOW("Ports", "POLYED.1") then
- address 'POLYED.1'
- else do
- say "PolyEd is not running!"
- exit
- end
- end
-
- 'LOCKGUI'
-
- /*----- begin of custom code area --------------------------------------*/
-
- 'GETATTR APPLICATION FLAG_AUTOINDENT' /* orig. state of auto-indent */
- state = RESULT
- 'SETATTR APPLICATION FIELD FLAG_AUTOINDENT NEWVALUE 1' /* enable auto-indent */
- 'POSITION EOL' /* move cursor to end of line */
- 'TEXT NEWLINE' /* create a new line (indents automatically) */
- 'SETATTR APPLICATION FIELD FLAG_AUTOINDENT NEWVALUE' state /* reset to orig. state */
-
- /*----- end of custom code area ----------------------------------------*/
-
- 'UNLOCKGUI'
- EXIT
-
- SYNTAX: /* ARexx error... */
-
- say "Error line" SIGL ":" ERRORTEXT(RC) /* report it... */
- 'UNLOCKGUI' /* Unlock GUI! */
- EXIT /* exit */
-
- FAILURE:
- 'UNLOCKGUI' /* Unlock GUI! */
- EXIT /* exit */
-